/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cz.muni.fi.pb138.avradiation.export.xml;

import cz.muni.fi.pb138.avradiation.Sensor.Sensor;
import java.io.FileOutputStream;
import java.net.URI;
import java.util.Collection;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;

/**
 *
 * @author David Simansky
 */
public interface XMLexport {
    
    /**
     * Method to initialize document from org.w3c.dom for the xml export
     * @throws ParserConfigurationException 
     */
    public void initDocument() throws ParserConfigurationException;
    
    /**
     * Creates DOM tree for the desired sensor chosen by user
     * The structure of elements and attributes is given by XML Schema, that is
     * located in svn repository /trunk/data/XMLSchema/radiation.xsd
     * @param sensors
     * @throws ParserConfigurationException 
     */
    public void processDocument(Collection<Sensor> sensors)  throws ParserConfigurationException ;
    
    /**
     * Transforms the processed sensors to xml document and saves it to given URI
     * @param uri output file
     * @param sensors processed sensors
     * @throws ParserConfigurationException
     * @throws TransformerConfigurationException
     * @throws TransformerException 
     */
    public void exportToXML(URI uri, Collection<Sensor> sensors) throws ParserConfigurationException,
            TransformerConfigurationException, TransformerException ;

}
